<?php

class Pages extends MY_Controller {

    public function __construct() {
        parent::__construct();

        $this->load->model('main/menu_model');
        $this->load->helper('download');
       
    }

    public function index($page = 'index') {

        $page = "main/" . $page;

        if (!file_exists('application/views/' . $page . '.php')) {
            // Whoops, we don't have a page for that!
            show_404();
        }

        //$data['title'] = ucfirst($page); // Capitalize the first letter
        
        $data['title'] = 'Главная';


        $this->_render($page, $data);
    }

    public function contact() {

        $page = "main/contact";

        if (!file_exists('application/views/' . $page . '.php')) {
            // Whoops, we don't have a page for that!
            show_404();
        }

        $data['title'] = 'Контакты'; // Capitalize the first letter



        $this->_render($page, $data);
    }

    public function download() {


        $data = file_get_contents(base_url()."/media/download/1c77exchange.zip"); // Считывает содержимое файла
        $name = '1c77exchange.zip';

        force_download($name, $data);
    }

}

?>
